home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 January: Mac OS SDK / Dev.CD Jan 96 SDK / Dev.CD Jan 96 SDK1.toast / Development Kits (Disc 1) / AOCE / Development Tools / Sample Code / Catalog Service Access Module / DTS Sample CSAM / MakeFile < prev   
Encoding:
Makefile  |  1993-11-03  |  6.2 KB  |  261 lines  |  [TEXT/MPS ]

  1. #
  2. # This MPW script builds the DTS Sample CSAM.
  3. # Copyright © 1992-93, Apple Computer Inc. All Rights Reserved.
  4. #
  5. # A full build takes about 20 minutes on a Mac-IIci using
  6. # virtual memory.
  7. #
  8. # (<CMD>/B: DTSSampleCSAM)
  9. #
  10. # Definitions
  11. #    Src                    C and assembler sources
  12. #    Obj                    Object files
  13. # If you modify Audit.c and/or Audit.h, be sure to copy the
  14. # current sources into the {Src} folder.
  15. #
  16. DestinationVolume =    `volumes "{Target}"`
  17. Src                    =    ":Src:"
  18. Obj                    =    ":Obj:"
  19.  
  20. #
  21. # These definitions duplicate definitions in DTSSampleCSAM.h
  22. #
  23. # kDriverCodeFile            The location of the driver code resource
  24. #                            file in the source build directory tree
  25. # kTemplateCodeFile            The location of the template code resource
  26. #                            file in the source build directory tree
  27. # kIconResourceFile            The location of the icon "source" file
  28. # kCSAMCreatorID            The registered creator id
  29. #
  30. # Grr: don't put spaces in the following: MPW will win out.
  31. #
  32. kDriverCodeFile            =    "{Obj}DTSSampleDRVR.code"
  33. kTemplateCodeFile        =    "{Obj}DTSSampleTemplate.code"
  34. kIconResourceFile        =    "DTSSampleIcons"
  35. kCSAMOutputFile            =    "DTSSampleCSAM"
  36. kCSAMCreatorID            =    'Pdsm'
  37. #
  38. # This is for debugging
  39. #
  40. kThinkCSAMOutputFile    =    "DTSSampleCSAM_Think" 
  41. #
  42. # Define the Rez source files
  43. #
  44. kCSAMResourceFiles        =                    ∂
  45.         {Src}DTSSampleCSAM.r                ∂
  46.         {Src}DTSSampleCSAMDriver.r            ∂
  47.         {Src}DTSSampleCSAMTemplate.r
  48.  
  49. #
  50. # Compiler definitions
  51. #
  52. COptions    = -b2 -mbg full -trace never -r    ∂
  53.     -d "kCSAMCreatorID={kCSAMCreatorID}"
  54. AOptions    = -wb
  55.  
  56. #
  57. # Directory dependencies. "Everything in the
  58. # {Obj} directory depends on something in the
  59. # {Src} directory."
  60. #
  61. {Obj}            ƒ    {Src}
  62.  
  63. #
  64. # Compiler dependencies -- common to all compilations
  65. # The idea here is that all sources are stored in
  66. # the {Src} subdirectory, and all objects (and code
  67. # resources output by the linker) are stored in the
  68. # {Obj} subdirectory. Also, all C source files depend
  69. # on the DTSSampleCSAM.h header file, while all ASM
  70. # source files depend on DriverGlue.incl.a.
  71. #
  72. .c.o ƒ .c                                    ∂
  73.         {Src}DETUtilities.h                    ∂
  74.         {Src}Audit.h                        ∂
  75.         {Src}DTSSampleCSAM.h
  76.     C {COptions}                            ∂
  77.         -o {TargDir}{Default}.c.o            ∂
  78.         {DepDir}{Default}.c
  79.  
  80. .a.o ƒ .a {Src}DriverGlue.incl.a
  81.     {Asm} {AOptions}                        ∂
  82.         -o {Obj}{Default}.a.o                ∂
  83.         {Src}{Default}.a
  84.  
  85. #
  86. # This command builds the CSAM
  87. #
  88. CSAM                    ƒ                    ∂
  89.             {kCSAMOutputFile}
  90.         Echo "Done"
  91.  
  92. #
  93. # Create the CSAM by combining the code files
  94. # with the various resources.
  95. #
  96. "{kCSAMOutputFile}"        ƒ                    ∂
  97.         MakeFile                            ∂
  98.         "{kIconResourceFile}"                ∂
  99.         "{kDriverCodeFile}"                    ∂
  100.         "{kTemplateCodeFile}"                ∂
  101.         {kCSAMResourceFiles}
  102.     Rez        -c {kCSAMCreatorID}                ∂
  103.             -t 'dash'                        ∂
  104.             -i "{CIncludes}"                ∂
  105.             -i "{Obj}"                        ∂
  106.             -rd                                ∂
  107.             -d "kCSAMCreatorID={kCSAMCreatorID}" ∂
  108.             -d "Think_Rez=0"                ∂
  109.             -o "{kCSAMOutputFile}"            ∂
  110.             {Src}DTSSampleCSAM.r            
  111.     SetFile    -a SBi                            ∂
  112.             -c {kCSAMCreatorID}                ∂
  113.             -t 'dash'                        ∂
  114.             "{kCSAMOutputFile}"
  115.             
  116. #
  117. # This is for debugging. The following commands
  118. # decompile (somewhat) the CSAM's built with
  119. # MPW and/or Think, then compare the two. They
  120. # are not very useful.
  121. #
  122. "{kCSAMOutputFile}.Derez"    ƒ                ∂
  123.         "{kCSAMOutputFile}"                    ∂
  124.         MakeFile
  125.     DeRez    {kCSAMOutputFile}                ∂
  126.             -s 'icl8' -s 'ics8'    -s 'icl4'    ∂
  127.             -s 'ics4' -s 'SICN'    -s 'ICN#'    ∂
  128.             -s 'ics#' -s 'BNDL' -s 'FREF'    ∂
  129.             -s 'detc' -s 'DRVR'                ∂
  130.             "{RIncludes}OCE.r"                ∂
  131.             "{RIncludes}Types.r"            ∂
  132.             -i "{RIncludes}"                ∂
  133.             -i "{CIncludes}"                ∂
  134.             > "{kCSAMOutputFile}.Derez"
  135.  
  136. "{kThinkCSAMOutputFile}.Derez"    ƒ            ∂
  137.         "{kThinkCSAMOutputFile}"            ∂
  138.         MakeFile
  139.     DeRez    "{kThinkCSAMResourceFile}"        ∂
  140.             -s 'icl8' -s 'ics8'    -s 'icl4'    ∂
  141.             -s 'ics4' -s 'SICN'    -s 'ICN#'    ∂
  142.             -s 'ics#' -s 'BNDL' -s 'FREF'    ∂
  143.             -s 'detc' -s 'DRVR'                ∂
  144.             {RIncludes}OCE.r                ∂
  145.             {RIncludes}Types.r                ∂
  146.             -i {RIncludes}                    ∂
  147.             -i {CIncludes}                    ∂
  148.             > "{kThinkCSAMOutputFile}.Derez"
  149.  
  150. CSAM.Diff                     ƒ                ∂
  151.         "{kCSAMOutputFile}.Derez"            ∂
  152.         "{kThinkCSAMOutputFile}.Derez"
  153.     Compare                                    ∂
  154.             "{kCSAMOutputFile}.Derez"        ∂
  155.             "{kThinkCSAMOutputFile}.Derez"    ∂
  156.             > CSAM.Diff
  157.  
  158. #
  159. # This checks that the two CSAM variants have
  160. # the same set of resources. There will be a
  161. # few length differences as the info resource
  162. # and code resources are, indeed, different.
  163. #
  164. CSAM.ResEqualDiff            ƒ                ∂
  165.         "{kCSAMOutputFile}"                    ∂
  166.         "{kThinkCSAMOutputFile}"
  167.     ResEqual                                ∂
  168.             "{kCSAMOutputFile}"                ∂
  169.             "{kThinkCSAMOutputFile}"            ∂
  170.             > CSAM.ResEqualDiff
  171.  
  172.  
  173. #
  174. # Print out all source code
  175. #
  176. Print                ƒ                        ∂
  177.         "{kCSAMOutputFile}"
  178.     Print -font Courier                        ∂
  179.             -h                                ∂
  180.             -size 9                            ∂
  181.             -tabs 4                            ∂
  182.         MakeFile                            ∂
  183.         {Src}≈.h                            ∂
  184.         {Src}≈.c                            ∂
  185.         {Src}≈.r
  186.  
  187. #
  188. # The CSAM driver code resource. Note that
  189. # MPW's DRVRRuntime.o is not used.
  190. # MPWDriverGlue.a.o must be first
  191. #
  192. DriverObjects =                                ∂
  193.         {Obj}MPWDriverGlue.a.o                ∂
  194.         {Obj}AddCatalog.c.o                    ∂
  195.         {Obj}Audit.c.o                        ∂
  196.         {Obj}AuditLibrary.c.o                ∂
  197.         {Obj}Callbacks.c.o                    ∂
  198.         {Obj}CSAM_DSParseProc.c.o            ∂
  199.         {Obj}CSAM_DSProc.c.o                ∂
  200.         {Obj}DirectoryInterface.c.o            ∂
  201.         {Obj}DirParseCommon.c.o                ∂
  202.         {Obj}DTSSampleCSAM.c.o                ∂
  203.         {Obj}GetCSAMIcon.c.o                ∂
  204.         {Obj}GetPABFSSpecCB.c.o                ∂
  205.         {Obj}GetRefNumFromRLI.c.o            ∂
  206.         {Obj}MPWCallCompletion.a.o            ∂
  207.         {Obj}ProcessPDCommands.c.o            ∂
  208.         {Obj}RemoveCatalog.c.o
  209.  
  210. "{kDriverCodeFile}"            ƒ                ∂
  211.         MakeFile                            ∂
  212.         {DriverObjects}
  213.     Link {SymOptions}                         ∂
  214.             -sg SampleCSAM                    ∂
  215.             -m main                            ∂
  216.             -ra SampleCSAM=resSysHeap,resLocked,resPreload ∂
  217.             -rt DRVW=0                        ∂
  218.             -o "{kDriverCodeFile}"            ∂
  219.         {DriverObjects}                        ∂
  220.         "{Libraries}Interface.o"
  221.     SetFile -t rsrc -c 'RSED' {kDriverCodeFile}
  222.  
  223. #
  224. # The DTS Sample CSAM Template code segment.
  225. # DTS_CSAMTemplate.c.o must be first as O.C.E.
  226. # jumps to the start of the module.
  227. #
  228. TemplateObjects =                            ∂
  229.         {Obj}DTS_CSAMTemplate.c.o            ∂
  230.         {Obj}Audit.c.o                        ∂
  231.         {Obj}DETUtilities.c.o
  232.  
  233. "{kTemplateCodeFile}"            ƒ            ∂
  234.         MakeFile                            ∂
  235.         {TemplateObjects}
  236.     Link {SymOptions}                         ∂
  237.             -sg SampleDET                    ∂
  238.             -m MAIN                            ∂
  239.             -ra SampleDET=resSysHeap,resLocked,resPreload ∂
  240.             -rt detc=0                        ∂
  241.             -o "{kTemplateCodeFile}"        ∂
  242.         {TemplateObjects}                    ∂
  243.         "{Libraries}Interface.o"
  244.     SetFile -t rsrc -c 'RSED' "{kTemplateCodeFile}"
  245.  
  246. #
  247. # This command reformats all source files 
  248. #
  249. ReformatSource                ƒ
  250.         {Src}DTSSampleCSAM.h
  251.     for foo in {Src}≈
  252.         echo {foo}
  253.         open {foo}
  254.         format -f Courier -s 10 {foo}
  255.         close {foo}
  256.     end
  257.  
  258. #
  259. # End
  260. #
  261.